﻿using Melee.Controller.Request;
using Melee.Controller.Routing;

namespace Melee.Controller.Handlers
{
    public class SignOutHandler : RequestHandler
    {
        public SignOutHandler()
            : base(Routes.SIGN_OUT)
        {
        }

        public override void Handle(WebRequest webRequest)
        {
            if (Route.Matches(webRequest))
            {
                webRequest.Cookie.Remove();
                webRequest.AsyncResult.SetCompleted();
            }
            else
            {
                base.NextHandler.Handle(webRequest);
            }
        }
    }
}
